<?php
namespace App\Http\Controllers;

use App\Services\IpBlacklistService;

class SomeController extends BaseController
{
    public function blockIp(Request $request, IpBlacklistService $blacklistService)
    {
        $ip = $request->input('ip');
        $blacklistService->addToBlacklist($ip, 120); // 封禁2小时
        
        return response()->json(['message' => 'IP已加入黑名单']);
    }
    
    public function viewBlacklist(IpBlacklistService $blacklistService)
    {
        $blacklist = $blacklistService->getActiveBlacklist();
        
        return response()->json($blacklist);
    }
}
